//
// Created by DELL on 2023/11/14.
//

#ifndef HEROCHASSISCODE_RAMP_H
#define HEROCHASSISCODE_RAMP_H

#include "main.h"

typedef struct ramp_t
{
    int32_t count;
    int32_t scale;
    float out;

    void (* init)(struct ramp_t* ramp, int32_t scale);

    float (* calc)(struct ramp_t* ramp);
} ramp_t;

#define RAMP_GEN_DAFAULT \
{ \
              .count = 0, \
              .scale = 0, \
              .out = 0, \
              .init = &ramp_init, \
              .calc = &ramp_calc, \
            } \


void ramp_init(ramp_t* ramp, int32_t scale);

float ramp_calc(ramp_t* ramp);

#endif //HEROCHASSISCODE_RAMP_H
